package com.softeem.demo1;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/1 9:19
 * @description
 */
public class demo1 {

    public static void exDemo(){
        int[] ii = new int[10];
        for (int i = 0; i < 11; i++) {
            System.out.println(ii[i]);
        }
    }
    public static void exDemo2(){

        FileInputStream fis = null;
        try {
            fis = new FileInputStream("test.txt");
            byte[] buffer = new byte[1024];
            int len = 0;
            while ((len = fis.read(buffer))!=1){
                System.out.println(new String(buffer,0,len));
            }
        } catch (FileNotFoundException e) {
            System.out.println("不存在");
            e.printStackTrace();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            System.out.println(1111);
        }
    }

    public static void main(String[] args) {
        Student1 s1 = new Student1();
        s1.setName("张三");
        try {
            s1.setAge(102);
        } catch (Myex e) {
            e.printStackTrace();
        }
    }
}
